package cc.lj.internal.api.coupons.api.ticket;

import cc.lj.internal.api.core.config.FeignConfiguration;
import cc.lj.internal.api.coupons.api.ticket.fallbackfactory.TicketPackageFeignServiceFallbackFactory;
import cc.lj.internal.api.coupons.dto.TicketBatchApiDTO;
import cc.lj.internal.api.coupons.dto.command.BindTicketPackageAPICommand;
import cc.lj.internal.api.coupons.dto.command.SendPackageAPICommand;
import cc.lj.internal.core.exception.SysExceptionEnum;
import cc.lj.internal.core.http.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * 电子券包表对外feign api
 * @author liangxifeng
 * @date 2023/8/24 15:39
 */
@FeignClient(contextId = "f-lj-internal-coupons-ticketPackageFeignService",
        name = "lj-internal-coupons",
        //url = "http://192.168.15.110:8050",
        url = "${feign.couponsUrl}", //后续如果使用nacos服务发现，则将改行去掉即可
        path = "ticketPackage",
        configuration = {FeignConfiguration.class},
        fallbackFactory = TicketPackageFeignServiceFallbackFactory.class
)
public interface TicketPackageFeignService {
    /**
     * 修改券包关联活动状态
     */
    @PostMapping("/updateBind")
    HttpResult<Integer> updateBind(@RequestBody BindTicketPackageAPICommand bindTicketPackageAPICommand);

    /**
     * 发券包接口
     */
    @PostMapping("/sendPackage")
    HttpResult<List<String>> sendPackage(@RequestBody SendPackageAPICommand sendPackageAPICommand);
}
